<?php
	/**
	 * 
	 * Redistribution and use in source and binary forms, with or without
	 * modification, are permitted provided that the following conditions are met:
	 *
	 *     * Redistributions of source code must retain the above copyright
	 *       notice, this list of conditions and the following disclaimer.
	 *     * Redistributions in binary form must reproduce the above copyright
	 *       notice, this list of conditions and the following disclaimer in the
	 *       documentation and/or other materials provided with the distribution.
	 *     * Neither the name of the University of California, Berkeley nor the
	 *       names of its contributors may be used to endorse or promote products
	 *       derived from this software without specific prior written permission.
	 *
	 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY
	 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
	 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
	 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
	 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
	 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	 * 
	 * 
	 * Arquivo de inicialização do pSQLite
	 * @author Bruno Pitteli Gonçalves <scorninpc<at>gmail<dot>com>
	 * @author Carlos Henrrique Marques <rickadt<at>gmail<dot>com>
	 * @version Revision 2
	 * @license BSD license
	 *
	 *	Change log
	 *	Revision 2:
	 *		Initial file
	 */
	
	/**
	 * Get arguments
	 */
	foreach($argv as $argument)
	{
		switch($argument)
		{
			case '--debug':
				//$onDebug = TRUE;
			break;
		}
	}
	
	/**
	 * Change error display method
	 * @since Revision 2
	 */
	if($onDebug)
	{
		error_reporting(E_ALL);
		ini_set('display_errors', TRUE);
	}
	else
	{
		error_reporting(E_ERROR | E_PARSE);
		ini_set('display_errors', FALSE);
	}
	
	/**
	 * Verify Gobject class
	 * @since Revision 2
	 */
	if(defined("Gobject::TYPE_STRING")) 
	{
		define("TYPE_STRING", Gobject::TYPE_STRING);
	}
	else
	{
		define("TYPE_STRING", Gtk::TYPE_STRING);
	}

	/**
	 * Load sqlite class
	 * @since Revision 2
	 */
	if(!file_exists("sqlite.class.php"))
	{
		die("SQLite Class not found.\n");
	}
	require_once("sqlite.class.php");

	/**
	 * Load psqlite Interface
	 * @since Revision 2
	 */
	if(!file_exists("psqlite.interface.php"))
	{
		die("pSQLite Interface Class not found.\n");
	}
	require_once("psqlite.interface.php");

	/**
	 * Load psqlite Interface
	 * @since Revision 2
	 */
	if(!file_exists("prostatusbar.widget.php"))
	{
		die("ProStatusBar Class not found.\n");
	}
	require_once("prostatusbar.widget.php");
	
	/**
	 * Load scintilla constants
	 * @since Revision 2
	 */
	if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
	{
		define("SCINTILLA_STYLE_FONT", '-*-courier new-*-*-*-*-*-90-*-*-*-*-*-*');
	}
	else
	{
		define("SCINTILLA_STYLE_FONT", '-*-courier-medium-r-normal-*-12-*-*-*-*-*-*');
	}
	define("SCINTILLA_SQL_WHITE_SPACE", 0);
	define("SCINTILLA_SQL_COMMENT_BLOCK", 1);
	define("SCINTILLA_SQL_COMMENT_LINE", 2);
	define("SCINTILLA_SQL_COMMENT_DOC", 3);
	define("SCINTILLA_SQL_NUMBER", 4);
	define("SCINTILLA_SQL_KEYWORD", 5);
	define("SCINTILLA_SQL_DOUBLE_STRING", 6);
	define("SCINTILLA_SQL_SINGLE_STRING", 7);
	define("SCINTILLA_SQL_SYMBOLS", 8);
	define("SCINTILLA_SQL_PREPROCESSOR", 9);
	define("SCINTILLA_SQL_OPERATOR", 10);
	define("SCINTILLA_SQL_IDENTIFIER", 11);
	define("SCINTILLA_SQL_STRING_EOL", 12);
	define("SCINTILLA_STYLE_DEFAULT", 32);
	define("SCINTILLA_STYLE_LINE_NUMBER", 33);
